<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>操作员看板</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<link rel="stylesheet" href="${pageContext.request.contextPath }/assets/css/layui.css"  media="all">
	<link rel="stylesheet" href="${pageContext.request.contextPath }/assets/css/toastr.min.css"  media="all">
</head>
<style>
#code{
	font-size:26px;width:400px;display:inline-block;height: 100px;
}
</style>
<body>
 
<script src="${pageContext.request.contextPath }/assets/layui.js" charset="utf-8"></script>
<script src="${pageContext.request.contextPath }/assets/layui.all.js"></script>
<script src="${pageContext.request.contextPath }/assets/js/jquery.min.js" charset="utf-8"></script>
<script src="${pageContext.request.contextPath }/assets/js/toastr.min.js" charset="utf-8"></script>

<div style="background-color: #0997F7">
	<h2 style="color:#FFF">工位：离心机</h2>
</div>
<div style="text-align: center;line-height: 100px;margin-top: 100px">
	<input id="code" class="layui-input" type="text" value="" name="" readonly/>
	<br/>
	<div class="site-demo-button" id="layerDemo" style="margin-bottom: 0;">
		<button data-method="over" data-type="auto" id="over" class="layui-btn layui-btn-blue">完成</button>
		&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;
		<button data-method="offset" data-type="auto" id="bad" class="layui-btn layui-btn-blue">不合格</button>
	</div>
</div>
<div style="position:absolute;bottom:0;width:100%;background-color: #0997F7">
	<h2 style="color:#FFF">作业员：张三</h2>
</div>
<script>
layui.use(['table','layer','upload','form'], function(){
  var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
  form = layui.form;
  //触发事件
  var active = {
   offset: function(othis){
	   var content = '<form class="layui-form layui-card-body" id="formID">'+
						'<div class="layui-form-item"><label class="layui-form-label">物料名称</label><input class="layui-input" lay-verify="type" type="text" value="" style="width:300px;"></div>'+
						'<div class="layui-form-item"><label class="layui-form-label">数量</label><input class="layui-input" lay-verify="type" type="text" value="" style="width:300px;"></div>'+
					  		'<div class="layui-form-item">'+
					  		'<label class="layui-form-label">问题描述</label>'+
					  			'<div class="layui-input-block">'+
						  			'<input class="layui-input" readonly lay-verify="type" type="text" value="001" style="width:300px;">'+
					  			'</div>'+
					  		'</div>'+
					  		'<div class="layui-form-item">'+
					  			'<label class="layui-form-label">工位</label>'+
					  			'<div class="layui-input-block" style="width:300px">'+
						  			'<select class="layui-select" lay-verify="">'+
						  				'<option>请选择工位</option>'+
						  				'<option>组装工位</option>'+
						  				'<option>离心工位</option>'+
						  				'<option>固化工位</option>'+
						  				'<option>切割工位</option>'+
						  			'</select>'+
						  		'</div>'+
					  		'</div>'+
					  		'<div class="layui-form-item">'+
					  			'<label class="layui-form-label">来源</label>'+
					  			'<div class="layui-input-block">'+
						  			'<input class="layui-input" readonly lay-verify="type" type="text" value="001" style="width:300px;">'+
						  		'</div>'+
					  		'</div>'+
						'</form>';
	   var type = othis.data('type')
	   ,text = othis.text();
	   layer.open({
	     type: 1
	     ,title:['不合格报检',true]
	     ,area: ['500px', '400px']
	     ,offset: type //具体配置参考：http://www.layui.com/doc/modules/layer.html#offset
	     ,id: 'layerDemo'+type //防止重复弹出
	     ,content: content
	     ,btn: ['提交','取消']
	     ,btnAlign: 'c' //按钮居中
	     ,shade: 0 //不显示遮罩
	     ,success:function(layero, index){
			  form.render();
		  }
	     ,yes: function(){
	     	
	     }
	   });
	 }
  };
  
  $('#layerDemo .layui-btn').on('click', function(){
    var othis = $(this), method = othis.data('method');
    active[method] ? active[method].call(this, othis) : '';
  });
  
});
</script>
</body>
</html>